package classloader;

import classloader.module.ModuleBase;

public class Main {
	
	public static void main(String[] args) {
		new Main ();
	}
	
	public Main () {
		loadClass ();
		
		System.gc ();
		
		System.console ().readLine ("Press enter when module has been recompiled");
		
		loadClass ();
	}
	
	public void loadClass () {
		try {
			ModuleClassLoader pMcl = new ModuleClassLoader ("SomeModule");
			((ModuleBase) pMcl.getModule ()).sayHai ();
			//pMcl = null;
		} catch (Exception pException) {
			System.out.println(pException);
		}
	}
}